package com.java.jvm;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * 设置堆内存初始化大小和最大值
 * -Xmx100m -Xms100m
 */
public class HeapMemoryTests {
    public static void main(String[] args) throws InterruptedException {
        List<byte[]> list=new ArrayList<>();
        for(int i=0;i<10000;i++) {
            list.add(new byte[1024 * 1024]);//1m
            TimeUnit.SECONDS.sleep(1);
        }
    }
}
